import { createApp, createVNode } from 'vue'
import App from './App.vue'
const app = createApp(App)

// router
import router from './router/'
app.use(router)

// pinia
import { createPinia } from 'pinia'
app.use(createPinia())

// element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
app.use(ElementPlus, {
    locale: zhCn
})

// 全局注册element-plus动态图标
import * as Icons from '@element-plus/icons-vue'
const Icon = (props: { icon: string }) => {
    return createVNode( Icons[ props.icon as keyof typeof Icons ] )
}
app.component('Icon', Icon)

// 加载
import './assets/styles/zml.scss'
app.mount('#app')


